#创建目录
mkdir -p /home/nfs/clickhouse/data  /home/nfs/clickhouse/config

#复制配置
docker run -d --rm --name tmp_ch --ulimit nofile=262144:262144 yandex/clickhouse-server
docker cp tmp_ch:/etc/clickhouse-server/config.xml /home/nfs/clickhouse/config/
docker kill tmp_ch

#运行容器
docker kill ch
docker rm ch
docker run -d --name ch --network host --ulimit nofile=262144:262144 \
--restart=always \
-v /home/nfs/clickhouse/data:/var/lib/clickhouse \
-v /home/nfs/clickhouse/config/config.xml:/etc/clickhouse-server/config.xml \
yandex/clickhouse-server